Skip to content
← 回到文章列表

构建高效的 Agent 自动化 ​

As AI accelerates our work, it's getting harder to keep up. At Anthropic, simple agent automations are frequently used to help. They often run on a schedule, gather context in the background, and proactively tell us what we need to know. But it’s difficult to build effective agent automations: they can lose access to a source without anyone noticing or fail to follow our preferences.

AI 让工作越跑越快,人反而越来越跟不上。在 Anthropic,我们经常拿简单的 agent 自动化来帮忙。它们通常按计划运行,在后台收集上下文,主动告诉我们该知道的事。可要把 agent 自动化做好并不容易:它可能悄悄丢了某个信息源的访问权限却没人发现,也可能不照我们的偏好来。

Using Claude Managed Agents (beta), we built a reference implementation that reads custom sources (e.g., Slack and GitHub repos) on a schedule, tracks what changed since the last run, and posts what you need to know (e.g., to Slack). In this article, we walk through each step, share a reference implementation, and provide a command to run in Claude Code that configures the agent for you.

我们用 Claude Managed Agents(beta)做了一个参考实现:按计划读取自定义的信息源(比如 Slack 和 GitHub 仓库),记下从上次运行到现在有什么变化,再把你需要知道的内容发出去(比如发到 Slack)。这篇文章会一步步讲清楚,附上参考实现,还给一条能在 Claude Code 里跑的命令,替你把 agent 配好。

Get the code拿到代码 ​

The reference implementation is here. For an interactive walkthrough, run the command below in Claude Code. The claude-api skill can help set up the agent following the guidance in this article:

参考实现在这里。想要交互式的引导,就在 Claude Code 里跑下面这条命令。claude-api skill 会照这篇文章的指引帮你把 agent 搭起来:

/claude-api managed-agents-onboard https://claude.dev/blog/building-effective-agent-automations/

For this reference implementation, you need a Slack app (create it from the manifest) and a GitHub token. The provided files (shown below) are configuration for Claude API resources, including the agent, its environment, memory stores, vault, and deployment.

跑这个参考实现,你需要一个 Slack 应用(用 manifest 创建)和一个 GitHub token。仓库里给的文件(见下)是 Claude API 资源的配置,包括 agent、它的运行环境、记忆库、保管库和部署。

daily-brief/
├── agent.md                        模型、工具、指令
├── deployment.md                   计划、时区、预算、输入消息
├── environment.yaml                网络白名单
├── memory_store_preferences.yaml   用户偏好
├── memory_store_state.yaml         agent 的书签、台账、笔记和运行记录
├── vault.yaml                      存放凭据的保管库
├── claude-lock.json                资源 ID,由 ant apply 写入
└── slack/manifest.yaml             一个机器人应用

ant apply, a command in the ant CLI, reads these files, creates the resources in your Claude API workspace (where the platform stores and runs them), and records the IDs in claude-lock.json.

ant apply 是 ant CLI 里的一条命令。它读这些文件,在你的 Claude API 工作区(平台存放和运行这些资源的地方)里把资源建出来,再把 ID 记进 claude-lock.json。

We'll use this command in the sections below. Once configured, the automation runs on a schedule on Anthropic's infrastructure, so nothing has to stay running on your machine.

后面几节都会用到这条命令。配好以后,这个自动化就在 Anthropic 的基础设施上按计划运行,所以你的机器上什么都不用一直开着。

Overview概览 ​

The agent we’ll build has six components, covered in this order:

我们要搭的 agent 有六个部件,按下面的顺序讲:

  • Sources - A named list of places to read信息源:一份清单,逐个写明要读哪些地方
  • Destination - One place the agent may write目的地:agent 唯一可以写的地方
  • Agent - The model, tools, and run steps in agent.mdAgent:agent.md 里的模型、工具和运行步骤
  • Schedule - A cron schedule计划:一个 cron 计划
  • Memory - Your preferences and the agent's own memory记忆:你的偏好,加上 agent 自己的记忆
  • Guardrails - Read-only access wherever the agent only reads, and a spending cap per run护栏:凡是只读的地方都给只读权限,每次运行设一个花费上限

agent 的架构:计划唤醒 agent,agent 从信息源读取内容,把简报发到唯一的目的地交给读者。记忆里存着 agent 的状态和读者的偏好,护栏围在 agent 四周。

Architecture of the agent: a schedule wakes the agent, which reads from its sources and posts a brief to one destination for the reader. Memory holds the agent's state and the reader's preferences, and guardrails surround the agent.

agent 的架构:计划唤醒 agent,agent 从信息源读取内容,把简报发到唯一的目的地交给读者。记忆里存着 agent 的状态和读者的偏好,护栏围在 agent 四周。

Sources信息源 ​

The agent reads two default sources: Slack channels and GitHub pull requests. The channels and repos are listed in your preferences file. The template can be extended to use other sources.

agent 默认读两个信息源:Slack 频道和 GitHub 的 pull request。具体读哪些频道和仓库,列在你的 preferences 文件里。这个模板也可以扩展到别的信息源。

架构图,信息源部分高亮。信息源是只读的,通过 MCP 或 HTTPS 访问,凭据来自保管库,读到的内容交给 agent。

The architecture diagram with Sources highlighted. The sources are read-only, reached through MCP or HTTPS with credentials from a vault, and feed the agent.

架构图,信息源部分高亮。信息源是只读的,通过 MCP 或 HTTPS 访问,凭据来自保管库,读到的内容交给 agent。

Give the agent its own, scoped credentials给 agent 一套它自己的、限定范围的凭据 ​

With Managed Agents, credentials live in vaults. The agent can reference these credentials but the real values stay in the vault, outside the sandbox where Claude's code runs (see here and here):

在 Managed Agents 里,凭据放在保管库(vault)中。agent 可以引用这些凭据,但真实的值一直留在保管库里,在 Claude 跑代码的沙箱(sandbox)之外(详见这里和这里):

  • MCP servers (GitHub). The agent calls MCP tools through a proxy that runs outside the sandbox. The proxy finds the vault credential whose URL matches the server’s.MCP 服务器(GitHub)。 agent 通过一个跑在沙箱外面的代理调用 MCP 工具。代理去保管库里找 URL 和这台服务器对得上的那条凭据。
  • The shell (Slack). The agent calls the Slack API with curl using the bash tool inside the sandbox. The sandbox only holds an opaque placeholder, $SLACK_BOT_TOKEN. As the request leaves the sandbox, the platform swaps in the real token for hosts you allow.Shell(Slack)。 agent 在沙箱里用 bash 工具跑 curl 调 Slack API。沙箱里只有一个看不出内容的占位符 $SLACK_BOT_TOKEN。请求离开沙箱时,只要目标是你允许的主机,平台就把真 token 换进去。

Create the vault using the ant CLI and the template file in the repo:

用 ant CLI 和仓库里的模板文件创建保管库:

ant apply vault.yaml

This creates the vault in your Claude API workspace, where the platform stores it, and records its ID in claude-lock.json. Then add each credential to the vault with the TypeScript SDK. Here is an example showing addition of the Slack credential:

这会在你的 Claude API 工作区里建好保管库(平台把它存在那儿),再把它的 ID 记进 claude-lock.json。然后用 TypeScript SDK 把凭据一条条加进去。下面是加 Slack 凭据的例子:

ts
const vaultId = process.env.VAULT_ID!; // 保管库的 ID,从 claude-lock.json 里取

await client.beta.vaults.credentials.create(vaultId, {
  display_name: "SLACK_BOT_TOKEN",
  auth: {
    type: "environment_variable",
    secret_name: "SLACK_BOT_TOKEN",
    secret_value: process.env.SLACK_BOT_TOKEN!,
    networking: { type: "limited", allowed_hosts: ["slack.com"] },
    injection_location: { header: true },
  },
});

After creating the vault and adding each credential, attach the vault to the deployment. Copy the vault ID from claude-lock.json into vault_ids in the deployment file, deployment.md.

保管库建好、凭据都加进去之后,把保管库挂到部署上:从 claude-lock.json 里把保管库 ID 抄到部署文件 deployment.md 的 vault_ids 里。

Read from where you left off从上次停下的地方接着读 ​

A common mistake is asking the agent to read a fixed window like " the last 24 hours." A late run leaves a gap and an early run repeats items. Instead, give the agent a bookmark per source. At the end of each run, the agent writes the timestamp of the newest item it read from each source to one file, bookmarks.json, with an entry per source: "slack": "2026-09-14T13:02:11Z".

一个常见的错误是让 agent 读固定的时间窗口,比如「过去 24 小时」。哪次跑晚了就会漏掉一段,跑早了又会重复。更好的办法是每个信息源给 agent 一个书签。每次运行结束时,agent 把从每个信息源读到的最新一条的时间戳写进同一个文件 bookmarks.json,一个信息源一条:"slack": "2026-09-14T13:02:11Z"。

The next run starts from those bookmarks, so its window stretches or shrinks to cover everything since the last run. The bookmarks live in the memory store called state: a folder of text files that the platform mounts into every run's sandbox under /mnt/memory/ and keeps between runs. The agent reads and writes it with its ordinary file tools, and the instructions in agent.md tell it how.

下一次运行就从这些书签开始,窗口会自己拉长或缩短,正好覆盖上次以来的全部内容。书签放在一个叫 state 的记忆库(memory store)里。它是一个装着文本文件的文件夹,平台把它挂载到每次运行的沙箱里的 /mnt/memory/ 下,并在两次运行之间保留。agent 用普通的文件工具读写它,怎么读写由 agent.md 里的指令告诉它。

Don't mistake a failed read for a quiet day别把读取失败当成今天没事 ​

If an MCP server is down or its token has expired, the run still starts, just without that server's tools. The session logs an error, but the agent sees nothing from that source and reports "nothing new."

如果某台 MCP 服务器挂了,或者它的 token 过期了,运行照样会开始,只是少了这台服务器的工具。会话里会记一条错误,可 agent 从这个信息源什么也看不到,于是报告「没有新内容」。

Three rules in agent.md help fix this. When a source fails, the agent will: keep the source’s bookmark where it is, write the brief from the other sources, and end the brief with one line naming what it couldn't read ("pull requests unavailable this run"), so the reader is made aware.

agent.md 里有三条规则来补这个洞。某个信息源读失败时,agent 会:让这个信息源的书签原地不动;用其他信息源把简报写出来;在简报末尾加一行,说明哪里没读到(「本次运行无法读取 pull request」),让读者知道。

Destination目的地 ​

Our template posts to one Slack channel, with a dated post each time it runs.

我们的模板只往一个 Slack 频道发消息,每次运行发一条带日期的。

架构图,目的地部分高亮。agent 先检查今天的简报还没发过,再发到唯一的目的地,由它把简报送到读者手里。

The architecture diagram with Destination highlighted. After a check that today's brief isn't already posted, the agent posts to one destination, which delivers the brief to the reader.

架构图,目的地部分高亮。agent 先检查今天的简报还没发过,再发到唯一的目的地,由它把简报送到读者手里。

The agent posts to Slack using the bash tool in its sandbox, using the same bot token it reads with.

agent 在沙箱里用 bash 工具往 Slack 发消息,用的就是它读消息时那个机器人 token。

Nothing has to approve the post. The agent sends it with a bash command, and the built-in bash tool runs without asking for approval by default. slack.com is also on the allowlist of the agent's environment, the sandbox it runs in. The post is one request:

发消息不需要谁批准。agent 用一条 bash 命令发出去,内置的 bash 工具默认不请求批准就会执行。slack.com 也在 agent 的环境(environment)白名单(allowlist)上,环境就是 agent 运行所在的沙箱。发消息只要一个请求:

curl -s https://slack.com/api/chat.postMessage \
  -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{"channel": "C0123456789", "text": "Daily brief, Tue Sep 15 ..."}'

Confirm the post landed before recording it确认消息发到了,再记下来 ​

Once a post is confirmed, the agent updates its ledger of reported items and its bookmarks. If those records don't match what was actually posted, two things can go wrong. If the agent records a post that never landed, the bookmarks move on and those items are never reported. If it posts again because it isn't sure the first post landed, readers get the same brief twice.

消息确认发出去之后,agent 会更新它的已报告条目台账和书签。要是这些记录和实际发出去的对不上,会出两种问题。agent 记下了一条其实没发到的消息,书签就往前走了,那些条目再也不会被报告。它拿不准第一条发到没有又发一遍,读者就会收到两份一样的简报。

Three rules in agent.md prevent this. First, the agent looks for today's title in the channel's recent messages and doesn't post if the edition is already there. Second, the post counts as sent only if Slack returns "ok": true and a message ts. Third, the agent updates the ledger and bookmarks only after that confirmation. If the result is unclear, it marks the run "maybe posted" and changes nothing else, so nothing is lost.

agent.md 里有三条规则防这个。第一,agent 先在频道最近的消息里找今天的标题,今天这期已经在了就不发。第二,只有 Slack 返回 "ok": true 和消息的 ts,才算发出去了。第三,拿到这个确认之后,agent 才更新台账和书签。结果说不清的时候,它把这次运行标成「可能已发送」,别的什么都不改,这样就不会丢东西。

The agent keeps a run record in its memory store (runs/<date>.md). It marks the run "posting" before the post, then "posted" with the message ID, or "maybe posted."

agent 在记忆库里为每次运行留一份记录(runs/<date>.md)。发之前标成「发送中」,发完标成「已发送」并附上消息 ID,或者标成「可能已发送」。

AgentAgent ​

In Claude Managed Agents, an agent is a versioned configuration: a model, a system prompt, and tools. Each run follows its run steps and stops.

在 Claude Managed Agents 里,agent 是一份带版本的配置:一个模型、一段系统提示词、一组工具。每次运行按它的运行步骤走完就停。

架构图,Agent 部分高亮:一个模型,加上一段承载运行循环和判断规则的提示词。

The architecture diagram with the Agent highlighted: a model plus a prompt that holds the run loop and the judgement rules.

架构图,Agent 部分高亮:一个模型,加上一段承载运行循环和判断规则的提示词。

In our reference implementation, the agent configuration is agent.md:

在我们的参考实现里,agent 的配置就是 agent.md:

---
name: Daily brief
model: claude-sonnet-5-5
mcp_servers:
  - type: url
    name: github
    url: https://api.githubcopilot.com/mcp/
tools:
  - type: agent_toolset_20260401
    configs:
      - name: web_search
        enabled: false
      - name: web_fetch
        enabled: false
  - type: mcp_toolset
    mcp_server_name: github
    default_config:
      permission_policy:
        type: always_allow
---

[Eight numbered run steps; the full text is in agent.md in the repo.]

The frontmatter supplies the agent name, model, tools, and MCP servers. The body provides the agent instructions. MCP tools ask for approval by default and nobody is there to give it, so the GitHub toolset is set to always_allow and the GitHub token is read-only.

frontmatter 给出 agent 的名字、模型、工具和 MCP 服务器,正文是给 agent 的指令。MCP 工具默认要请求批准,可没人在那儿批,所以 GitHub 工具集设成了 always_allow,相应地 GitHub token 是 read-only 的。

Keep the brief short简报要短 ​

agent.md steers Claude toward brevity:

agent.md 引导 Claude 往简短里写:

4. Decide. An item earns a line when the reader would act on it today, or it changes a decision they are about to make. When unsure, leave it out. Most days that is a few items, sometimes none. A count ("12 open reviews") is not an item; link the ones that are blocked. An item already in the ledger and still open is carried as one marked line ("still waiting, day 3"), not re-reported; a closed item is dropped without comment. Do not bring back a topic the preferences file has retired.

Re-check anything still open right before posting发之前,把还没了结的再查一遍 ​

Items can change between when the agent reads sources and when it posts. Just before posting, agent.md instructs the agent to re-check the live status of each item:

从 agent 读信息源到它发消息,中间这段时间条目可能已经变了。agent.md 要求 agent 在发之前,逐条重新查一下实时状态:

5. Verify. The world moved while you read. For every item you will report, re-check its live source just before posting: resolved since you read it, drop it; still open but changed, fix the line; cannot confirm, drop it and list it in the run record's cuts. One stale "still waiting on you" costs more trust than ten missing items, so never hedge an item's status: assert it or drop it. Every link is copied from the source's own link field (a pull request's html_url, a Slack permalink), never assembled by hand.

Schedule计划 ​

With Claude Managed Agents, the agent is only a configuration file; a deployment runs it. The deployment names the agent, environment, and the first message of each run. It also holds the schedule, vault, memory stores, and budget. Each time the schedule fires, the platform starts a fresh agent session.

在 Claude Managed Agents 里,agent 只是一份配置文件,真正跑它的是部署(deployment)。部署指定用哪个 agent、哪个环境,以及每次运行的第一条消息,还管着计划、保管库、记忆库和预算。计划每触发一次,平台就新开一个 agent 会话(session)。

架构图,计划部分高亮:一个按计划运行的部署,每次运行时把 agent 唤醒。

The architecture diagram with Schedule highlighted: a scheduled deployment that wakes the agent for each run.

架构图,计划部分高亮:一个按计划运行的部署,每次运行时把 agent 唤醒。

In our template, the deployment is captured in deployment.md, with the first message as its body:

在我们的模板里,部署写在 deployment.md 里,正文就是第一条消息:

---
name: Daily brief
agent: ./agent.md
environment_id: ./environment.yaml
schedule:
  type: cron
  expression: "32 7 * * 1-5"
  timezone: America/New_York
vault_ids: [vlt_...]   # 在「信息源」那一节里创建的保管库
resources:
  - path: ./memory_store_preferences.yaml
    access: read_only
    instructions: The reader's preferences. Re-read them every run. Never write here.
  - path: ./memory_store_state.yaml
    access: read_write
    instructions: Your state. Bookmarks, ledger, notes, proposals, and run records.

---

Write today's brief.
The reader's time zone is America/New_York. Work out every date in that zone.

Follow your run steps in order. Today's edition is titled "Daily brief, <weekday> <month> <day>".

This creates the deployment with the agent, environment and memory stores it names by path.

下面这条命令会创建部署,连同它按路径指定的 agent、环境和记忆库。

ant apply deployment.md

To test it without waiting for the schedule, start a run by hand with ant beta:deployments run --deployment-id <id>, using the ID from claude-lock.json.

想测试又不想等计划触发,可以用 ant beta:deployments run --deployment-id <id> 手动跑一次,ID 从 claude-lock.json 里取。

Compute dates in your time zone按你的时区算日期 ​

A common bug is the agent calling this morning "yesterday" because it computes dates in the server's time zone. In deployment.md, the timezone field sets when the run fires and the second line of the body tells the agent which zone to use for dates.

一个常见的 bug 是 agent 把今天早上说成「昨天」,因为它按服务器的时区算日期。在 deployment.md 里,timezone 字段决定运行什么时候触发,正文第二行告诉 agent 算日期用哪个时区。

Memory记忆 ​

Each run starts in a fresh sandbox with no memory of the last one. Without memory, feedback doesn't stick. However, stale memory can confuse the agent: it reports an item as still waiting after it was resolved, or drops one that's still open because it was "already reported."

每次运行都从一个全新的沙箱开始,不记得上一次的事。没有记忆,反馈就留不住。可过期的记忆也会把 agent 搞糊涂:一件事已经解决了,它还报「仍在等待」;一件事还没了结,它却因为「已经报过了」就不提了。

架构图,记忆部分高亮。状态由 agent 读写;偏好由读者来写,agent 只读。

The architecture diagram with Memory highlighted. State is what the agent reads and writes, and Preferences is what the reader writes and the agent only reads.

架构图,记忆部分高亮。状态由 agent 读写;偏好由读者来写,agent 只读。

Our template keeps two memory stores, the folders mounted under /mnt/memory/ (see Sources):

我们的模板有两个记忆库,也就是挂载在 /mnt/memory/ 下的那两个文件夹(见「信息源」一节):

  • preferences (yours, read-only to the agent): which channels and repos to read, what to leave out, the length cap, the destination, and when to stop.preferences(归你,对 agent 只读):读哪些频道和仓库、哪些内容不要、篇幅上限、目的地,以及什么时候停。
  • state (the agent's, read-write): the bookmarks, a ledger of what it reported, one record per run, changes it proposes to your preferences, and notes on how each source behaves ("returns only the newest 50 items").state(归 agent,可读可写):书签、已报告内容的台账、每次运行一份的记录、它对你的偏好提出的修改建议,以及关于各个信息源脾气的笔记(「只返回最新的 50 条」)。

ant apply deployment.md creates the preferences store, but not the file in it. Before the first run, write your preferences.md there with the repo's scripts/seed-preferences.sh.

ant apply deployment.md 会建好 preferences 这个记忆库,但不会建里面的文件。第一次运行之前,用仓库里的 scripts/seed-preferences.sh 把你的 preferences.md 写进去。

Re-read your preferences at the start of every run每次运行开始时都重读一遍偏好 ​

A common problem occurs when a copy of the preferences is baked into the prompt, which keeps applying rules you've already changed. Have the agent read the file fresh every run. If it can't read the file, it should stop and say so instead of running on defaults.

一个常见的问题是把偏好抄一份写死在提示词里,结果你早改掉的规则它还在照用。让 agent 每次运行都现读这个文件。读不到的话,它应该停下来说明情况,而不是拿默认值接着跑。

Keep a ledger of what you've already reported, and report the change给已经报过的内容记一本台账,只报变化 ​

The agent keeps a ledger, ledger.md, of every item it has reported, so the brief doesn't repeat itself. Each line records when the item was reported, where it came from, an ID that doesn't change (a Slack message timestamp or a pull request number), and its last known status:

agent 用一本台账(ledger)ledger.md 记下它报过的每一条,这样简报就不会翻来覆去说同样的事。每行记着这条是什么时候报的、从哪儿来的、一个不会变的 ID(Slack 消息的时间戳或 pull request 编号),以及它最后已知的状态:

2026-09-09 slack:C0123456789 1788963600.000100 refund thread: customer waiting on a decision
2026-09-11 github 481 review blocked, day 2 (still waiting)
2026-09-11 slack:C0234567891 1789117333.000300 enterprise escalation: owner named, in progress

Guardrails护栏 ​

Because our automation runs in the “background” on a schedule, we set limits on what the agent can do and what it can spend.

因为这个自动化是按计划在「后台」跑的,我们给 agent 能做什么、能花多少钱都设了限制。

架构图,护栏部分高亮:围在 agent 四周的一道边界,对轮数、时长和花费设了上限,还有一个有人盯着的心跳。

The architecture diagram with Guardrails highlighted: a boundary around the agent with caps on turns, time and spend, and a heartbeat that someone watches.

架构图,护栏部分高亮:围在 agent 四周的一道边界,对轮数、时长和花费设了上限,还有一个有人盯着的心跳。

Limits on what it can do限制它能做什么 ​

The agent reads messages and issues that other people wrote, and that text can be interpreted as instructions. Limit what the agent could do if it followed them. In our example, the GitHub token and the preferences store are read-only, and the environment only reaches the hosts on its allowlist. A planted instruction can still change what the brief says, including through the notes the agent keeps between runs. It can't write to GitHub or edit your rules.

agent 读的是别人写的消息和 issue,这些文字可能被它当成指令。所以要限制住:就算它照着做了,能做的事也有限。在我们的例子里,GitHub token 和 preferences 记忆库都是只读的,环境也只能访问白名单上的主机。被人埋进去的指令仍然可以改变简报的内容,包括借 agent 在两次运行之间留的笔记来改。但它没法往 GitHub 写东西,也没法改你的规则。

Slack is the exception: the same token posts, so invite the bot only where it needs to read or post.

Slack 是个例外:发消息用的也是同一个 token,所以只把机器人拉进它需要读或者需要发的频道。

Set the spending cap from real runs按真实运行的数据定花费上限 ​

A spending cap protects you from runaway costs. Start at three to five times the cost of a normal run, then tighten it as you see real numbers. A run that hits its cap pauses instead of failing, so a cap set too low looks like a brief that went quiet. The cap is the budget in deployment.md. Every run gets the full amount, and a run that reaches it pauses with a budget_reached stop reason:

花费上限能防止费用失控。先设成一次正常运行成本的三到五倍,看到真实数字之后再往下收。撞到上限的运行会暂停而不是报错,所以上限设得太低,看起来就像简报突然不说话了。上限就是 deployment.md 里的 budget。每次运行都有完整的额度,用到顶的那次会暂停,停止原因是 budget_reached:

budget:
  type: limit
  max_list_cost:
    amount: "500" # 字符串,单位是美分:"500" 就是 5.00 美元
    currency: USD

Getting started上手 ​

Our reference implementation comes down to six rules:

我们的参考实现归结起来是六条规则:

  • Read each source from a bookmark, not a fixed time window.每个信息源都从书签开始读,不用固定的时间窗口。
  • Report a failed read as unreadable, never as a quiet day.读取失败就报「读不到」,绝不说成今天没事。
  • Re-check every item right before posting.发之前把每一条都再查一遍。
  • Count a post as sent only when Slack confirms it, then update bookmarks and ledger.Slack 确认了才算发出去,之后再更新书签和台账。
  • Re-read your preferences every run, from a store the agent can't edit.每次运行都重读偏好,偏好放在 agent 改不了的记忆库里。
  • Give the agent read-only access wherever it only reads, and cap what each run can spend.凡是 agent 只读的地方都给只读权限,并给每次运行的花费设上限。

Claude Code can walk you through the guidance provided in this article. First, update:

Claude Code 可以带你把这篇文章的指引走一遍。先更新:

claude update

Then, use the claude-api skill:

然后用 claude-api skill:

/claude-api managed-agents-onboard https://claude.dev/blog/building-effective-agent-automations/

The claude-api skill reads this post, proposes a setup, writes the files to an agents/ folder in your project, and creates the resources with ant apply. Treat this as a starting point, and customize the agent for your sources, destination, or memory preferences.

claude-api skill 会读这篇文章,提出一套配置方案,把文件写进你项目里的 agents/ 文件夹,再用 ant apply 把资源建出来。把它当作起点,再按你自己的信息源、目的地或记忆偏好去定制这个 agent。

最后更新: